/**
 * @file color_config.cpp
 * @brief Brief description of color_config.cpp
 * @author achdu0000@163.com
 * @version 1.0.0
 * @date 2024/07/09
 *
 */

#include "color_config.h"

#define WUXING_COLOR_WHITE (lv_color_white())
#define WUXING_COLOR_BLACK (lv_palette_darken(LV_PALETTE_GREY, 3))
#define WUXING_COLOR_RED (lv_color_hex(0xDC143C))
#define WUXING_COLOR_GREEN (lv_palette_main(LV_PALETTE_GREEN))
#define WUXING_COLOR_YELLOW (lv_palette_darken(LV_PALETTE_YELLOW, 2))
#define WUXING_COLOR_PURPLE (lv_palette_main(LV_PALETTE_PURPLE))

#define YINYANG_COLOR_WHITE (lv_color_white())
#define YINYANG_COLOR_BALCK (lv_color_black())

// ==================================================
// =============== IMPLEMENTATION ===================
// ==================================================

lv_color_t get_wuxing_color(WUXING wx)
{
    lv_color_t color;
    switch (wx)
    {
    case WX_JIN:
        color = WUXING_COLOR_WHITE;
        break;
    case WX_SHUI:
        color = WUXING_COLOR_BLACK;
        break;
    case WX_MU:
        color = WUXING_COLOR_GREEN;
        break;
    case WX_HUO:
        color = WUXING_COLOR_RED;
        break;
    case WX_TU:
        color = WUXING_COLOR_YELLOW;
        break;
    case WX_NOT_CLEAR:
        color = WUXING_COLOR_PURPLE;
        break;
    default:
        break;
    }
    return color;
}

lv_color_t get_yinyang_color(YINYANG yy)
{
    return (yy == YIN ? YINYANG_COLOR_BALCK : YINYANG_COLOR_WHITE);
}
